/*
 * @Author: lsjweiyi 759209794@qq.com
 * @Date: 2024-03-31 15:31:54
 * @LastEditors: lsjweiyi 759209794@qq.com
 * @LastEditTime: 2024-05-12 12:15:44
 * @FilePath: \web-ssg\nuxt.config.ts
 * @Description: nuxt配置
 */
import Components from "unplugin-vue-components/vite";
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
export default defineNuxtConfig({
    ssr: true,
    imports: {
        autoImport: true,
    },
    devServer: {
        port: 10000,
    },
    nitro: {
        // 启动压缩
        compressPublicAssets: true,
    },
    experimental: {
        payloadExtraction: false,
    },
    app: {
        // 修改打包的目录名称
        buildAssetsDir: "dist",
        head: {
            link: [{ rel: "icon", type: "image/jpeg", href: "/images/AI.png" }],
        },
        pageTransition: false, // 禁用页面过去
        layoutTransition: false, // 禁用布局过渡
    },
    build: {
        transpile: process.env.NODE_ENV === "production" ? ["naive-ui", "vueuc", "@css-render/vue3-ssr", "@juggle/resize-observer"] : ["@juggle/resize-observer"],
    },
    vite: {
        optimizeDeps: {
            include: process.env.NODE_ENV === "development" ? ["naive-ui", "vueuc", "date-fns-tz/formatInTimeZone"] : [],
        },
        plugins: [
            Components({
                resolvers: [NaiveUiResolver()],
            }),
        ],
    },
});
